package com.example.module_c;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class Module_c extends AppCompatActivity implements View.OnClickListener {

    @SuppressLint("MissingInflatedId")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_module_c);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });
        findViewById(R.id.iv_lun).setOnClickListener(this);
        findViewById(R.id.iv_serve).setOnClickListener(this);
        findViewById(R.id.tv_serve).setOnClickListener(this);
        findViewById(R.id.ll_news).setOnClickListener(this);
        findViewById(R.id.iv_subway).setOnClickListener(this);
        findViewById(R.id.tv_subway).setOnClickListener(this);
        findViewById(R.id.iv_home).setOnClickListener(this);
        findViewById(R.id.tv_home).setOnClickListener(this);
        findViewById(R.id.iv_technology).setOnClickListener(this);
        findViewById(R.id.tv_technology).setOnClickListener(this);
        findViewById(R.id.iv_serves).setOnClickListener(this);
        findViewById(R.id.tv_serves).setOnClickListener(this);
        findViewById(R.id.tv_hospital).setOnClickListener(this);
        findViewById(R.id.iv_hospital).setOnClickListener(this);
        findViewById(R.id.ll_qingnianyizhan).setOnClickListener(this);
        findViewById(R.id.ll_gerenzhongxin).setOnClickListener(this);

    }

    @Override
    public void onClick(View view) {
        if (view.getId()==R.id.iv_lun || view.getId()==R.id.ll_news){
            Intent intent = new Intent(Module_c.this, news.class);
            startActivity(intent);
        }
        if (view.getId()==R.id.iv_serve || view.getId()==R.id.tv_serve  ||view.getId()==R.id.iv_serves || view.getId()==R.id.tv_serves){
            Intent intent = new Intent(Module_c.this,Serve.class);
            startActivity(intent);
        }
        if (view.getId() == R.id.iv_subway || view.getId() == R.id.tv_subway){
            Intent intent = new Intent(Module_c.this,Subway.class);
            startActivity(intent);
        }if (view.getId() == R.id.iv_home || view.getId() == R.id.tv_home) {
            Intent intent = new Intent(Module_c.this, Home.class);
            startActivity(intent);
        }if (view.getId() == R.id.iv_technology || view.getId() == R.id.tv_technology) {
            Intent intent = new Intent(Module_c.this, Technology.class);
            startActivity(intent);
        }if (view.getId() == R.id.iv_hospital || view.getId() == R.id.tv_hospital) {
            Intent intent = new Intent(Module_c.this, Hospital.class);
            startActivity(intent);
        }if (view.getId() == R.id.ll_quanbufuwu){
            Intent intent = new Intent(Module_c.this,Teenager.class);
            startActivity(intent);
        }if (view.getId() == R.id.ll_gerenzhongxin){
            Intent intent = new Intent(Module_c.this,Teenager.class);
            startActivity(intent);
        }
//        Intent intent = new Intent(Module_c.this, news.class);
//        startActivity(intent);
    }
}